var loginname = sessionStorage.getItem("loginname");
if (loginname != "") {
    $("#loginname").val(loginname);
}

$(function () {

    $(".inputClass").blur(function () {
        var id = $(this).attr("id");//获取当前输入框的id  
        var funName = "validate" + id.substring(0, 1).toUpperCase() + id.substring(1) + "()";//得到对应的校验函数名  
        eval(funName);//执行函数调用  
    });

});

$("#btnRegister").click(function () {
    var bool = true;//表示校验通过  
    var name = $("#loginname").val();
    if (name == null || name == undefined || name == '') {
        UIkit.modal.alert("登录名不能为空！");
        return;
    }

    $.ajax({
        type: "GET",
        url: GetBaseUrl() + "/users/verification/" + name,
        dataType: "json",
        success: function (msg) {
            if (msg.code == 0) {
       
                sessionStorage.setItem(name + "email", msg.data);

                window.location.href = "resetpwd2.html?loginname=" + name;
            }
            else {
                UIkit.modal.alert(msg.msg);
            }
        }

    });

})